package com.mijie.homi.search.service.index;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import com.mijie.core.IBatisDao;
import com.mijie.homi.common.domain.topic.Topic;
import com.mijie.homi.search.api.UserSearchApi;
import com.mijie.homi.search.dao.mood.MoodDao;
import com.mijie.homi.search.dao.topic.TopicDao;
import com.mijie.homi.search.util.listUtil;


@Component
public class dbc4Ibatis  extends IBatisDao  {
	
	
	
	@Autowired
	TopicDao tpcdao;
	@Autowired
	private SqlSessionTemplate sqlSession;
	
	public static void main(String[] args) throws SQLException {
		UserSearchApi.iniProxool();
		dbc4Ibatis c = (dbc4Ibatis) UserSearchApi.getbean("dbc4Ibatis");
		String prblmIds_str = "100,1000,2000";
		ResultSet rs = c.getrs("getTopicsByIds",prblmIds_str);
		while (rs.next()) {
			String id = rs.getString("id");
			System.out.println(id);
		}
		
	}

	public ResultSet getrs(String sqlID,Object param) {
		
		List li=sqlSession.selectList(sqlID,  param);;
		 
		 return  listUtil.toResultSet(li);
	 
	}

}
